<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>定制滚动条</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        .box {
            height: 100px;
            overflow-y: scroll;
            overflow-x: hidden;
            -webkit-overflow-scrolling: touch;
        }
        ::-webkit-scrollbar {
            border-radius: 3px;
            background: rgb(0,0,0);
            box-shadow: inset 0 0 5px rgba(0,0,0,.8);
        }
        ::-webkit-scrollbar-thumb {
            border-radius: 3px;
            background: rgba(255,0,0);
            box-shadow: inset 0 0 10px rgba(0,0,0,.2)
        }
    </style>
</head>
<body>
    <div class="box">
        <p>aaa</p>
        <p>aaa</p>
        <p>aaa</p>
        <p>aaa</p>
        <p>aaa</p>
        <p>aaa</p>
        <p>aaa</p>
        <p>aaa</p>
        <p>aaa</p>
        <p>aaa</p>
        <p>aaa</p>
        <p>aaa</p>
        <p>aaa</p>
        <p>aaa</p>
        <p>aaa</p>
        <p>aaa</p>
        <p>aaa</p>
        <p>aaa</p>
        <p>aaa</p>
        <p>aaa</p>
    </div>
</body>
</html>